package main

/**
 * @Author: DengLibin
 * @Date: Create in 2023-01-17 11:55:46
 * @Description:392. 判断子序列
 示例 1：

输入：s = "abc", t = "ahbgdc"
输出：true
示例 2：

输入：s = "axc", t = "ahbgdc"
输出：false
*/

func isSubsequence(s string, t string) bool {
	var i, j int
	lt := len(t)
	for _, c := range s {

		for i = j; i < lt; i++ {
			if t[i] == byte(c) {
				break
			}
		}
		if i == lt {
			return false
		}
		j = i + 1
	}
	return true
}
